import { http } from '@/utils/http/axios';

/**
 * 获取tree组织列表
 * @param params
 */
export function getOrgTree(params?) {
  return http.request({
    url: '/sys/org',
    method: 'GET',
    params,
  });
}
/**
 * 获取组织详情
 * @param params
 */
export function getOrgInfo(params) {
  return http.request({
    url: '/sys/org/info',
    method: 'GET',
    params,
  });
}
/**
 * @description: 组织新增
 */
export function createOrg(data) {
  return http.request({
    url: '/sys/org',
    method: 'POST',
    data,
  });
}
/**
 * @description: 组织修改
 */
export function updateOrg(data) {
  return http.request({
    url: '/sys/org',
    method: 'PUT',
    data,
  });
}
/**
 * @description: 删除组织
 */
export function deleteOrg(params) {
  return http.request({
    url: '/sys/org',
    method: 'DELETE',
    params,
  });
}
/**
 * 通过code获取组织树
 * @param params
 */
export function getOrgTreeByCode(params?) {
  return http.request({
    url: '/sys/org/tree/exclude',
    method: 'GET',
    params,
  });
}
